#include <Kharlia/Engine/Common.h>
#include <Kharlia/Engine/Net.h>
#include <Kharlia/Engine/Units.h>

namespace kharlia { namespace engine {

int GetFieldSize(EFieldType type) {
    // TODO: Should be some magic template way to do this much more nicely
    switch (type) {
    case FT_SENTRY:
        throw RuntimeError();
    case FT_INT:
        return sizeof(int);
    case FT_UINT:
        return sizeof(int);
    case FT_FLOAT:
        return sizeof(float);
    case FT_DOUBLE:
        return sizeof(double);
    case FT_ENUM:
        return sizeof(int);
    case FT_BOOL:
        return sizeof(bool);
    case FT_PYOBJECT:
        return sizeof(object);
    case FT_PYSTR:
        return sizeof(str);
    case FT_PYUNICODE:
        return sizeof(object);
    case FT_VECTOR3F:
        return sizeof(FVector3F);
    case FT_SHARED_PTR_ACTOR:
        return sizeof(shared_ptr<void>);
    default:
        throw RuntimeError();
    }
}

}}